<!-- 用户列表 -->
<div class="pcontent">
<h3>节点管理<a class="addBtn btn btn-info btn-sm pull-right" href="javascript:void(0)" d_title="模块" d_id="0" d_level="1" >添加模块</a></h3>
<volist name="list" id="m">
	<table class="m_box table table-border">
		<thead>
			<tr>
				<th colspan="2">
					<span class="label label-sm label-success">
						{$m.title} 
						<i class="addBtn glyphicon glyphicon-plus" title="添加控制器" d_title="控制器" d_id="{$m.id}" d_level="2" ></i> 
						<i class="delBtn glyphicon glyphicon-remove" title="删除模块" d_id="{$m.id}"></i>
					</span>
				</th>
			</tr>
		</thead>
		<tbody  class="c_box">
		<volist name="m.child" id="c">
			<tr class="ab_box">
				<td width="120px"> 
					<span class="label label-info">
						{$c.title} 
						<i class="addBtn glyphicon glyphicon-plus" title="添加方法" d_title="方法" d_id="{$c.id}" d_level="3" ></i> 
						<i class="delBtn glyphicon glyphicon-remove" title="删除控制器" d_id="{$c.id}"></i>
					</span>
				</td>
				<td class="a_box">
					<volist name="c.child" id="a" >
					<span class="label label-warning">{$a.title} 
						<i class="delBtn glyphicon glyphicon-remove" title="删除方法"  d_id="{$a.id}"></i>
					</span>
					</volist>
				</td>
			</tr>
		</volist>
		</tbody>
	</table>
</volist>
<div class="modal fade" id="module-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		 <div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel"></h4>
			</div>
			<div class="modal-body">
				<form id="bjy-form" class="form-inline" action="{:U('/Access/node_save')}" method="post">
					<input type="hidden" name="level" id="level" value="0">
					<input type="hidden" name="pid" id="pid" value="0"> 
					<table class="table table-striped table-bordered table-hover table-condensed">
						<tr>
							<th width="12%">name：</th>
							<td><input class="form-control" type="text" name="name"></td>
						</tr>
						<tr>
							<th width="12%">名称：</th>
							<td><input class="form-control" type="text" id="d_title" name="title"></td>
						</tr>
						<tr>
							<th width="12%">标记：</th>
							<td><input class="form-control" type="text" id="d_remark" name="remark"></td>
						</tr>
						<tr>
							<th></th>
							<td>
								<input class="btn btn-success" type="submit" value="添加">
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>
</div>
<!-- 添加模块 End -->

<script language="javascript">
$(function(){
	$('.addBtn').click(function(){
		$('#myModalLabel').text('添加'+$(this).attr('d_title'));
		$('#level').val($(this).attr('d_level'));
		$('#pid').val($(this).attr('d_id')); 
		$('#module-add').modal('show');
	});
	$('.delBtn').click(function(){
		var url = 'node_del/id/'+$(this).attr('d_id');
		if(confirm('你确认删除吗?')) { location.href = url; }
	});
	
	$('#d_title').change(function(){ $('#d_remark').val($('#d_title').val()); });
});
</script>
<!-- 添加用户 -->